import { ObjectOnlyPushSet } from '../../../global';
import { emptydata } from '../../../global/Classes/cla_emptydata/Classes/cla_emptydata';
import { win_operate } from '../DataDefine/sourceData';

/**
 * 将 操作符 暴露到 window 上
 * @param {string} spacename 域 名
 * @param {string} name 当前 自定义 名
 * @param {any} operate_obj 操作 对象
 */
export function set_win_operate_obj(spacename, name, operate_obj) {
  if (window[win_operate] == undefined) {
    window[win_operate] = new emptydata();
  }
  if (window[win_operate][spacename] == undefined) {
    window[win_operate][spacename] = new emptydata();
  }

  ObjectOnlyPushSet(window[win_operate][spacename], name, operate_obj);
}
